<?php

use yii\helpers\Url;
use yii\helpers\Html;

//use backend\assets\CommonAsset;
//$asset = CommonAsset::register($this);
$controller = Yii::$app->controller->id;

$action = Yii::$app->requestedAction->id;
?>

<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <?php echo Html::csrfMetaTags(); ?>
        <title><?php echo Html::encode($this->title); ?>-后台管理</title>
        <link href="<?php echo Yii::$app->homeUrl; ?>css/common/base.css" rel="stylesheet">
        <link href="<?php echo Yii::$app->homeUrl; ?>css/common/common.css" rel="stylesheet">
        <link rel="stylesheet" href="<?php echo Yii::$app->homeUrl; ?>css/common/bootstrap.min.css">
        <link href="<?php echo Yii::$app->homeUrl; ?>css/common/daterangepicker-bs3.css" rel="stylesheet">
        <link href="<?php echo Yii::$app->homeUrl; ?>css/PassList.css" rel="stylesheet">
        <!-- The script -->
        <script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/jquery-2.1.1.min.js"></script>
        <script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/bootstrap.min.js"></script>
        <script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/extendPagination.js"></script>
        <script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/moment.js"></script>
        <script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/daterangepicker.js"></script>
        <?php $this->head() ?>
    </head>
    <body>
        <?php $this->beginBody() ?>
        <div id="header" class="row">
            <div class="h3">享点阅读管理后台</div>
            <ul class="nav-pills">
                <li><a href="<?php echo Url::to('/site/logout'); ?>">退出登录</a></li>
            </ul>
        </div>

        <!-- left menu starts -->
        <div class="Menuleft">
            <ul class="Celan">
                <li>
                    <h6>首页</h6>
                    <a href="<?php echo Url::to('/site/index'); ?>">首页</a>
                </li>

                <li>
                    <h6>书籍管理</h6>
                    <a class="<?php echo $controller == 'novel' && $action == 'index' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/novel/index'); ?>">书籍列表</a>
                </li>

                <li>
                    <h6>推文管理</h6>
                    <a class="<?php echo $controller == 'tweet' && $action == 'index' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/tweet/index'); ?>">推文列表</a>
                    <a class="<?php echo $controller == 'tweet' && $action == 'images' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/tweet/images'); ?>">图片库</a>
                    <a class="<?php echo $controller == 'title' && $action == 'index' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/title/index'); ?>">标题库</a>
                    <a href="#">二维码库</a>
                </li>

                <li>
                    <h6>渠道管理</h6>
                    <a class="<?php echo $controller == 'admin' && ($action == 'channel-lists' || $action == 'channel-info') ? 'ThisA' : ''; ?>" href="/admin/channel-lists">渠道列表</a>
                </li>

                <li>
                    <h6>用户管理</h6>
                    <a class="<?php echo $controller == 'user' && $action == 'reader' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/user/reader'); ?>">读者列表</a>
                    <a class="<?php echo $controller == 'user' && $action == 'visitor' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/user/visitor'); ?>">游客列表</a>
                </li>

                <li>
                    <h6>订单管理</h6>
                    <a href="<?php echo Url::to('/order/index'); ?>">订单订单</a>
                </li>

                <li>
                    <h6>账单管理</h6>
                    <a href="<?php echo Url::to('/bill/index'); ?>">充值记录</a>
                </li>

                <li>
                    <h6>系统管理</h6>
                    <a class="<?php echo $controller == 'admin' && $action == 'index' ? 'ThisA' : ''; ?>" href="<?php echo Url::to('/admin/index'); ?>">合作账号列表</a>
                </li>

<!--                <li>
                    <h6></h6>
                    <h6></h6>
                </li>-->
            </ul>
        </div>
        <?php echo $content ?>
        <?php $this->endBody() ?>
        <script>
            for (var i = 0; i < $(".Celan>li>a").length; i++) {
                $(".Celan>li>a").eq(i).click(function () {
                    $(".Celan>li>a").removeClass("ThisA")
                    $(".Celan>li>h6").removeClass("ThisH6")
                    $(this).addClass("ThisA")
                })
            }

            $(".Celan>li").eq(0).find("h6").click(function () {
                $(".Celan>li>a").removeClass("ThisA")
                $(this).addClass("ThisH6")
            })
        </script>
    </body>
</html>

<script>
    for (var i = 0; i < $(".Celan>li>a").length; i++) {
        $(".Celan>li>a").eq(i).click(function () {
            $(".Celan>li>a").removeClass("ThisA")
            $(this).addClass("ThisA")
        })

    
    }
	function getViewPortHeight() {
			 return document.documentElement.clientHeight || document.body.clientHeight;
		}
	var CelanH = getViewPortHeight()-80
	$(".Celan").css("height",CelanH)
//    $(".Celan>li").eq(0).find("h6").addClass("Celan_Li_H6")		/*移除首页的箭头*/
</script>
<script type="text/javascript" src="<?php echo Yii::$app->homeUrl; ?>js/DocuWidth.js"></script>
<?php $this->endPage() ?>
